package com.fare.taluo.vo.core;

import org.apache.commons.lang3.StringUtils;



public class HomeChannelCompare implements Comparable<HomeChannelCompare> {
	
	 /*content:agentName 天泰航空
	2013033120002CANCKG content:channelPrice 532
	2013033120002CANCKG content:homePrice 1171
	2013033120002CKGSHA content:agentName 快乐e行
	2013033120002CKGSHA content:channelPrice 203
	2013033120002CKGSHA content:homePrice 813*/
	
	private String agentName;//代理商名称
	private String channelPrice;//渠道价格
	private String flightBatch;
	private String flightBatchDate;
	private String grabChannel;
	private String grabChannelNum;
	private String grabDate;//抓取日期
	private String homePrice;//官网价格
	public String getGrabChannel() {
		return grabChannel;
	}


	public void setGrabChannel(String grabChannel) {
		this.grabChannel = grabChannel;
	}


	public String getGrabChannelNum() {
		return grabChannelNum;
	}


	public void setGrabChannelNum(String grabChannelNum) {
		this.grabChannelNum = grabChannelNum;
	}


	public String getGrabDate() {
		return grabDate;
	}


	public void setGrabDate(String grabDate) {
		this.grabDate = grabDate;
	}


//	PlaneInfos planeinfos;
//	ChannelPlaneinfo channelPlaneinfo;
//	
//	public PlaneInfos getPlaneinfos() {
//		return planeinfos;
//	}
//
//
//	public void setPlaneinfos(PlaneInfos planeinfos) {
//		this.planeinfos = planeinfos;
//	}
//
//
//	public ChannelPlaneinfo getChannelPlaneinfo() {
//		return channelPlaneinfo;
//	}
//
//
//	public void setChannelPlaneinfo(ChannelPlaneinfo channelPlaneinfo) {
//		this.channelPlaneinfo = channelPlaneinfo;
//	}
//

	public String getAgentName() {
		return agentName;
	}


	public void setAgentName(String agentName) {
		this.agentName = agentName;
	}


	public String getChannelPrice() {
		return channelPrice;
	}


	public void setChannelPrice(String channelPrice) {
		this.channelPrice = channelPrice;
	}


	public String getFlightBatch() {
		return flightBatch;
	}


	public void setFlightBatch(String flightBatch) {
		this.flightBatch = flightBatch;
	}


	public String getFlightBatchDate() {
		return flightBatchDate;
	}


	public void setFlightBatchDate(String flightBatchDate) {
		this.flightBatchDate = flightBatchDate;
	}


	public String getHomePrice() {
		return homePrice;
	}


	public void setHomePrice(String homePrice) {
		this.homePrice = homePrice;
	}


	public float getComparePrice(){
		//Collections
		try {
		if(StringUtils.isBlank(this.channelPrice)){
			this.channelPrice="0";
			Float.parseFloat(this.channelPrice);
		}
			Float hp = Float.parseFloat(this.homePrice);
			if(hp==0f){
				return 1*100;
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return (Float.parseFloat(this.channelPrice)/Float.parseFloat(this.homePrice)-1)*100;
	}


	@Override
	public int compareTo(HomeChannelCompare o) {
		if(this.getComparePrice()-o.getComparePrice()<0){return -1;}
		if(this.getComparePrice()-o.getComparePrice()>0){return 1;}
		return 0;
	}
	

}
